package yf.mall.service;

import yf.mall.entity.CartEntity;
import com.yf.service.BaseService;
import yf.mall.vo.CartVo;

import java.util.List;

/**
 * 购物车Service接口
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Fri Aug 23 11:38:38 CST 2019
 */
public interface CartService extends BaseService<CartEntity> {

    List<CartVo> findByUserId(Long userId);

    List<CartEntity> findByUserIdWithSelected(Long userId);

    List<CartEntity> findByUserIdAndCartIds(Long userId,List<Long> cartIds);

    /**
     * 改变购物车
     * @param cartId
     * @param amount
     */
    void change(Long userId,Long cartId,Integer amount,Boolean selected);

    /**
     * 产品界面加入购物车
     * @param userId
     * @param goodsId
     * @param skuName
     */
    void addCart(Long userId, Long goodsId, String skuName,Integer quantity);

    //全选或者取消全选
    void changeAllSelected(Long userId,boolean selected);

    //移除选中的购物车产品
    void deleteSelected(Long userId);

    //清空购物车
    void deleteAll(long userId);







}
